Skip to content

Migrate to agent core#216

Merged
rgbkrk merged 9 commits intomainfrom
migrate-to-agent-core
Sep 19, 2025
Merged

Migrate to agent core#216
rgbkrk merged 9 commits intomainfrom
migrate-to-agent-core

Conversation

@rgbkrk
Copy link
Copy Markdown
Member

@rgbkrk rgbkrk commented Sep 19, 2025

No description provided.

Major refactoring to consolidate runtime agent functionality:

✅ Updated all package imports:
- ai: @runt/lib → @runtimed/agent-core@^0.2.0
- pyodide-runtime-agent: @runt/lib → @runtimed/agent-core@^0.2.0
- python-runtime-agent: @runt/lib → @runtimed/agent-core@^0.2.0
- tui: @runt/lib → @runtimed/agent-core@^0.2.0

✅ Updated all source file imports:
- Replaced all 'from "@runt/lib"' with '@runtimed/agent-core'
- Fixed LogLevel type usage to work with const pattern
- Added temporary MediaBundle/validateMediaBundle for pyodide-runtime-agent

✅ All packages now type-check successfully

📋 TODO: Once @runtimed/agent-core exports are fully published:
- Remove temporary MediaBundle/validateMediaBundle definitions
- Restore VERSION import usage
- Update version references to latest

This allows consolidating all runtime agent functionality under the
@runtimed organization and eventually deprecating @runt/lib.
This fixes module resolution for lib tests that import from
@runtimed/agent-core.

⚠️ Known Issues:
- RuntimeAgentOptions API differences between @runt/lib and @runtimed/agent-core
- 'adapter' property removed, 'store' property now required
- Multiple test failures due to breaking API changes

These will need to be resolved once agent-core API is stabilized.
Updated to use the new @runtimed/agent-core API where:
- Store is created externally using createStorePromise
- Store is passed via runtimeOptions instead of adapter
- Sync payload is properly constructed using createRuntimeSyncPayload

✅ Changes:
- PyodideRuntimeAgent now expects store in runtimeOptions
- mod.ts creates store before instantiating agent
- Proper error handling for notebook ID requirement
- Store type imports added

This enables better in-browser agent support as intended
by the new agent-core architecture.
MediaBundle and validateMediaBundle are not yet available in @runtimed/schema@0.2.0.
Keeping temporary local definitions until schema exports are updated.

This maintains compatibility while we transition to the new package structure.
Fixed all test files to work with the new @runtimed/agent-core API:

✅ lib/test/mod.test.ts:
- Updated to create stores via createStorePromise
- Made tests async to handle store creation

✅ lib/test/runtime-agent-adapter-injection.test.ts:
- Replaced adapter passing with store creation
- Updated all test cases to create stores explicitly
- Proper sync payload creation for each test scenario

✅ pyodide-runtime-agent/test/config-cli.test.ts:
- Updated makeBaseConfig to be async and create stores
- Fixed assertThrows tests to handle async config creation
- Added fallback values for testing validation edge cases

All tests now compile successfully and use the intended
store-passing architecture. Ready for 0.x.0 breaking change release!
@rgbkrk rgbkrk marked this pull request as ready for review September 19, 2025 23:12
@rgbkrk rgbkrk merged commit 13a8047 into main Sep 19, 2025
7 checks passed
@rgbkrk rgbkrk deleted the migrate-to-agent-core branch September 19, 2025 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant